﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Collections.Specialized;

namespace MLVS.AppUtils.Settings
{
    public class AppConfig
    {
        public static class Constants
        {
            // DateTime Format
            public const String DEFAULT_DATE_FORMAT = "yyyy.MM.dd";
            public const String DEFAULT_DATETIME_FORMAT = "yyyy-MM-ddTHH:mm:ss";
        }
        public static NameValueCollection GetCustomSettings(String section)
        {
            return ConfigurationManager.GetSection(section) as NameValueCollection;
        }

        public static string GetSettingValue(string paramName)
        {
            return ConfigurationManager.AppSettings[paramName];
        }

        public static string GetSettingValue(string paramName, string valueDefault)
        {
            var valueStr = GetSettingValue(paramName);
            return String.IsNullOrEmpty(valueStr) ? valueDefault : valueStr;
        }
       
    }
}
